#初始化客户信息列表
customers = [
    {
    "name":"Bob",
    "age":25,
    "email":"bob@example.com"
    },  
    {
    "name":"Alice",
    "age":30,
    "email":"alice@example.com"
    }
]

while 1:
    print("""
        1. 添加客户信息
        2. 删除客户信息
        3. 修改客户信息
        4. 查询客户信息
        5. 显示所有客户信息
        6. 退出系统
        """)
    choice = input("请选择操作：")
    if choice == "1":
        name = input("请输入客户姓名：")
        age = input("请输入客户年龄：")
        email = input("请输入客户邮箱：")
        customer = {"name":name,"age":age,"email":email}
        customers.append(customer)
        print(f"添加{name}成功！")
    elif choice == "2":
        name = input("请输入要删除的客户姓名：")
        flag = False
        for customer in customers:
            if customer["name"] == name:
                customers.remove(customer)
                print("删除成功！")
                flag
                break
        if flag:
            print("当前客户列表：",customers)
        else:
            print(f"未找到客户{name}，删除失败！")

    elif choice == "3":
        name = input("请输入要修改的客户姓名：")
        flag = False
        for customer in customers:
            if customer["name"] == name:
                new_age = input("请输入新的年龄：")
                new_email = input("请输入新的邮箱：")
                customer["age"] = new_age
                customer["email"] = new_email
                print("修改成功！")
                flag = True
                break
        if not flag:
            print(f"未找到客户{name}，修改失败！")
    elif choice == "4":
        name = input("请输入要查询的客户姓名：")
        flag = False
        for customer in customers:
            if customer["name"] == name:
                print(f"客户信息：{customer}")
                flag = True
                break
        if not flag:
            print(f"未找到客户{name}")

    elif choice == "5":
        print("当前客户列表：",customers)

    elif choice == "6":
        print("感谢使用客户信息管理系统！")
        break